Component({
  mixins: [],
  data: {},
  props: {
    placeHolder: '输入你想知道的内容...',
    searchKey: '',
    onSearch: (data) => {}
  },
  didMount() {},
  didUpdate() {},
  didUnmount() {},
  methods: {
    onInput (e) {
      this.props.onSearch({
        searchKey: e.detail.value
      })
    },
    onConfirm (e) {
      const value = e.detail.value;
      if (value) {
        my.navigateTo({
          url: `/pages/list/list?search=${value}`,
        })
      }
    },
    onClear () {
      this.props.onSearch({
        searchKey: ''
      })
    }
  },
});
